home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / ASSEMBLE / 2743.ZIP / WASH1PRG.ASM < prev    next >
Assembly Source File  |  1980-01-01  |  1KB  |  65 lines

  1.  
  2. ; WASHING MACHINE (Version 1)
  3. ; name and date
  4.  
  5. ; constants
  6. portA    equ    6
  7. portB    equ    7
  8. controlport equ 9
  9. start    equ    1
  10. go       equ    2
  11. empty    equ    4
  12. full     equ    8
  13.  
  14.        out controlport,131   ; sets up 8255 i/o chip
  15.  
  16. start1 out portA,0  ; all outputs off
  17. start2 in a, portB
  18.        and a, 3     ; start + door open
  19.        cmp a, start ; door should be closed
  20.        jnz start2
  21.  
  22.        out portA, 26 ; water + soap + go
  23.        call waitfull
  24.        mov loopcount,3
  25.  
  26. loop  out portA, 67 ; go + rev + heat
  27.       call delay
  28.  
  29.       out portA, go
  30.       call delay
  31.  
  32.       dec loopcount
  33.       jnz loop
  34.  
  35.       out portA, 34 ; drain + go
  36.       call waitempty
  37.  
  38.       out portA, 10 ; water + go
  39.       call waitfull
  40.  
  41.       out portA, 34 ; drain + go
  42.       call waitempty
  43.  
  44.       out portA, 38 ; fast + go + drain
  45.       call delay
  46.  
  47.       jmp start1
  48.  
  49. loopcount ds 1
  50.  
  51. delay mov a, 4
  52. delay2 dec a
  53.       jne delay2
  54.       ret
  55.  
  56. waitfull in a,portB ; waits for drum to fill
  57.          and a,full
  58.          jz waitfull
  59.          ret
  60.  
  61. waitempty in a,portB ; waits for drum to empty
  62.           and a,empty
  63.           jz waitempty
  64.           ret                ;  wash1prg.asm  disk A26
  65.